﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter3.Section5
{
    public class Example03
    {
        public Example03()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double[], double[], double[]> f
                = new V.Function.ToLastType<double[], double[], double[]>(func);
            double[] x = { 1.0, 1.0 };
            double[] u = { 1.0, 1.0 };
            V.ImplicitFunctionTheorem obj
                = new V.ImplicitFunctionTheorem(f,x,u);
            obj.FindDeterminant();
            result += obj.Determinant.ToString() + "\r\n";         
        }
        private double[] func(double[] x, double[] u)
        {
            double[] f = new double[2];
            f[0] = x[0] * u[0] + x[1] * u[1] * u[0] * u[0] - 2.0;
            f[1] = x[0] * u[0] * u[0] * u[0] + x[1] * x[1] * u[1] * u[1] * u[1] * u[1] - 2.0;
            return f;
        }
    }
}
